package com.exercise.struct.utils

import android.content.res.Resources


fun Number.px2Dp(): Int {
    val scale = Resources.getSystem().displayMetrics.density
    return (this.toFloat() / scale + 0.5f).toInt()
}

fun Number.dp2Px(): Int {
    val scale = Resources.getSystem().displayMetrics.density
    return (this.toFloat() * scale + 0.5f).toInt()
}